<div class="archive">
<?php 
if ( have_posts() ) : ?>
<?php  while ( have_posts() ) : the_post();?>

<div class="hentry-meta"><h1><?php the_title(); ?></h1></div>
<section class="general-wrapper product">

<?php
	$emailAddress=get_post_meta($post->ID, "emailAddress", true);
	$phoneNumber=get_post_meta($post->ID, "phoneNumber", true);
	$contactPerson=get_post_meta($post->ID, "contactPerson", true);
	$siteURL=get_post_meta($post->ID, "siteURL", true);
	$youTubeVideo=get_post_meta($post->ID, "youTubeVideo", true);
	$address=get_post_meta($post->ID, "address", true);
	
	if($siteURL == "")
	{
		$siteURL = 'N/A';
	}elseif(!isValidURL($siteURL))
	{
		$siteURL = '<a style="text-decoration:underline" target="_new" href="http://'.$siteURL.'">'.$siteURL.'</a>';
	}
	else
	{
		$siteURL = '<a style="text-decoration:underline" target="_new" href="'.$siteURL.'">'.$siteURL.'</a>';
	}
?>

<div id="tabs">
	<ul>
		<!--<li><a href="#tabs-1">Introduction</a></li>-->
		<li><a href="#tabs-1">Contact Info</a></li>
        
	</ul>
	<!--<div id="tabs-1">
		<?php the_content()?>
	</div>-->
	<div id="tabs-1">
		<p><p><strong>Address</strong>: <?php echo ($address!=""?$address:"N/A"); ?></p>
		<p><strong>Tel</strong>: <?php echo ($phoneNumber!=""?$phoneNumber:"N/A"); ?></p>
		<p><strong>Email</strong>: <?php echo ($emailAddress!=""?$emailAddress:"N/A"); ?></p>
		<p><strong>Website</strong>: <?php echo $siteURL?></p>
</p>
	</div>
	
    
    
</div>
<?php 
endwhile;
endif;


function isValidURL($url)
{
	return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
}
?>

</div>
